package class202205.demo05.demo01;

public class demo20220501 {

    public static int func(int n){
        int result = 1;
        for (int i = 1; i <= n; i++) {
            result *=i;
        }
        return result;
    }

    public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            sum += func(i);
        }
        System.out.println(sum);
    }

}
